package com.yunyike.app.data.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yunyike.app.data.mapper.ShopPromotionMapper;
import com.yunyike.app.data.model.ShopPromotion;
import com.yunyike.app.data.service.IShopPromotionService;

@Service("shopPromotionServiceImpl")
public class ShopPromotionServiceImpl implements IShopPromotionService{

	private Logger log = LoggerFactory.getLogger(ShopPromotionServiceImpl.class);

	@Autowired
	private ShopPromotionMapper shopPromotionMapper;
	
	/**
	 * 根据店铺id 获取店铺促销信息
	 */
	public List<ShopPromotion> findPromotionByShopId(String shopId) {
		log.info("----->> find promotion By ShopId....");
		
		List<ShopPromotion> shopPromotions = shopPromotionMapper.findPromotionByShopId(shopId);
		
		log.info("----->> find promotion By ShopId end.");
		
		return shopPromotions;
	}

	public int insert(ShopPromotion shopPromotion) {

		return shopPromotionMapper.insertSelective(shopPromotion);
		
	}

}
